package com.project.service.Imp;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.UserBean;
import com.project.mapper.IUserMapper;
import com.project.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService implements IUserService {

    @Autowired
    private IUserMapper userMapper;

    @Override
    public UserBean login(String userName, String userPwd) {
        UserBean login = userMapper.login(userName, userPwd);
        return login;
    }

    @Override
    public PageInfo<UserBean> findByItem(Integer PageNo, String name, String dept) {
        PageHelper.startPage(PageNo,2);
        PageInfo<UserBean> of = PageInfo.of(userMapper.findByItem(name, dept));
        return of;
    }
}
